package day12;

import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;

public class TestQueue {
	public static void main(String[] args) {
		Queue q = new LinkedList();
		q.offer("aaa");
		q.offer("bbb");
		q.offer("ddd");
		q.offer("ccc");
		System.out.println(q.peek());
		System.out.println(q.peek());
	/*	System.out.println(q.poll());
		System.out.println(q.poll());
		System.out.println(q.poll());
		System.out.println(q.poll());
		System.out.println(q.poll());*/
/*		System.out.println(q.remove());
		System.out.println(q.remove());
		System.out.println(q.remove());
		System.out.println(q.remove());
		System.out.println(q.remove());*/
		Object o = null;
		while((o=q.poll())!=null){
			System.out.println(o);
		}
		System.out.println("==========================");
		PriorityQueue pq = new PriorityQueue();
		pq.offer(10);
		pq.offer(1);
		pq.offer(3);
		pq.offer(5);
		o = null;
		while((o=pq.poll())!=null){
			System.out.print(o+" ");
		}
	}
}




